<script src="js/jx.js">
</script>

<?php
require_once 'php-sdk/facebook.php' ;
require_once 'php-sdk/base_facebook.php' ;
require_once "gameAPI.php";
	
	$to = get_user_id();
?>
<div id="fb-root"></div>
			<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js">
			</script>
			<script type="text/javascript">
				FB.init({
					appId : '271211432894561',
					status : true, // check login status
					cookie : true, // enable cookies to allow the server to access the session
					xfbml : true, // parse XFBML
					oauth : false // disable OAuth since we're not ready for it
				});

				FB.ui(
					{
						method: 'feed',
						name: 'has hired you!',
						link: 'apps.facebook.com/frenfactory',
						picture: 'http://107.20.229.155/frenfactory/images/frenfactory_icon.png',
						caption: 'Help your friend increase credits!',
						description: 'Unwilling to stay as a worker? Play FrenFactory and run your own factory!',
						to: <?php echo $user; ?>,
					},
					function(response)
					{
						if (response && response.post_id) 
						{
							window.location.href='play.php';
						} 
						else 
						{
							window.location.href='play.php';
						}
					}
				);
			</script>
	